﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Common
{
    public static class ListHelper<T>
    {
        /// <summary>
        /// Gets the list.(往Ilist最前面插入一个值)
        /// </summary>
        /// <param name="sourceList">The source list.</param>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static IList<T> GetList(IList<T> sourceList, T value)
        {
            if (value==null)
            {
                return sourceList;
            }
            T[] targetList=new T[sourceList.Count];
            targetList[0]=value;
            sourceList.CopyTo(targetList, 0);
            return (IList< T >)targetList;
        }
    }
}
